﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Windows;
using Fluent;
using PefStudio.Base;
using PefStudio.StartUp;
using PefStudio.Windows;

namespace PefStudio.Windows
{
    public class AbstractRibbonButton : Button, IRibbonChildItem
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        private string _id;
        public string ID
        {
            get { return _id; }
            set
            {
                _id = value;
                Name = _id;
            }
        }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }
    }

    public class AbstractRibbonSplitButton : SplitButton, IRibbonChildItem
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        private string _id;
        public string ID
        {
            get { return _id; }
            set
            {
                _id = value;
                Name = _id;
            }
        }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }
    }

    public class AbstractRibbonComboBox : ComboBox, IRibbonChildItem
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        private string _id;
        public string ID
        {
            get { return _id; }
            set
            {
                _id = value;
                Name = _id;
            }
        }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }
    }

    public class AbstractRibbonDropDownButton : DropDownButton, IRibbonChildItem
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        private string _id;
        public string ID
        {
            get { return _id; }
            set
            {
                _id = value;
                Name = _id;
            }
        }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }
    }

    public class AbstractRibbonToggleButton : ToggleButton, IRibbonChildItem
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        private string _id;
        public string ID
        {
            get { return _id; }
            set
            {
                _id = value;
                Name = _id;
            }
        }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }
    }

    public class AbstractRibbonBackstageTabItem : BackstageTabItem, IRibbonChildItem
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        private string _id;
        public string ID
        {
            get { return _id; }
            set
            {
                _id = value;
                Name = _id;
            }
        }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }
    }
}
